#include "Light.h"

Light::Light(void)
{
}

Light::~Light(void)
{
	SAFE_DEL(m_Object);
}

void Light::Init(Object * object)
{
	m_Object = object;
}

Matrix Light::GetLightMatWVP(Vector3 target)
{
	Matrix mTrans;
	mTrans.SetTranslation(m_Object->m_Position);
	Matrix mLookAt;
	mLookAt.SetLookAt(m_Object->m_Position, target);
	Matrix mPerpestive;
	mPerpestive.SetPerspective(1.5707963267948966192313216916398, (float)SCREEN_W / SCREEN_H, 0.1, 500);
	return mLookAt * mPerpestive;
}

void Light::SetPosition(Vector3 position)
{
	m_Object->m_Position = position;
}

Vector3 Light::GetPosition()
{
	return m_Object->m_Position;
}